
// 在这里文件中配置路由规则
import Vue from 'vue'
import VueRouter from 'vue-router' // 导入Vue-router插件

// 全局注册VueRouter主键
Vue.use(VueRouter)

// 1.导入自定义组件
import index from "../view/index"
import emp from "../view/emp/emp"
import user from "../view/user/user"
import dept from "../view/dept/dept"
import role from "../view/role/role"
import menu from "../view/menu/menu"
import roleUser from "../view/role/roleUser"
import login from "../view/commons/login"
import verify from "../view/commons/verify"

// 2.配置映射关系
const routes = [
    {
        path: '/', component: index, children: [
            { path: '/emp', component: emp },
            { path: '/user', component: user },
            { path: '/dept', component: dept },
            { path: '/role', component: role },
            { path: '/menu', component: menu },
            { path: '/roleUser/:id', component: roleUser },
        ]
    },
    { path: '/login', component: login },
    { path: '/verify', component: verify },
]

// es6对象简写
export default new VueRouter({
    routes
})
